package cn.summit;

import java.io.IOException;

import org.springframework.core.type.AnnotationMetadata;
import org.springframework.core.type.ClassMetadata;
import org.springframework.core.type.classreading.MetadataReader;
import org.springframework.core.type.classreading.SimpleMetadataReaderFactory;

/**
 * @author summit
 * @since 2022/6/11 18:12
 */
public class MetaDataReaderTest {

	public static void main(String[] args) throws IOException {
		SimpleMetadataReaderFactory factory = new SimpleMetadataReaderFactory();

		MetadataReader metadataReader = factory.getMetadataReader("cn.summit.service.User1Service");

		ClassMetadata classMetadata = metadataReader.getClassMetadata();
		System.out.println(classMetadata.getClassName());


		AnnotationMetadata annotationMetadata = metadataReader.getAnnotationMetadata();
		for (String annotationType : annotationMetadata.getAnnotationTypes()) {
			System.out.println(annotationType);
		}
	}
}
